package com.tequila.bops.controller;

import com.tequila.core.service.BranchStoreService;
import com.tequila.domain.entity.BranchStore;
import com.tequila.domain.query.BranchStoreQuery;
import fe.core.ApiResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/branchSotre")
public class BranchStoreController {

    @Resource
    private BranchStoreService branchStoreService;

    @RequestMapping("/queryPageListByParam")
    public ApiResponse queryPageListByParam(BranchStoreQuery branchStoreQuery) {
        return ApiResponse.successApiResponse().withData(branchStoreService.queryPageListByParam(branchStoreQuery));
    }

    @RequestMapping("/queryById")
    public ApiResponse queryById(Long id) {
        return ApiResponse.successApiResponse().withData(branchStoreService.queryById(id));
    }

    @RequestMapping("/save")
    public ApiResponse save(BranchStore entity) {
        return ApiResponse.successApiResponse().withData(branchStoreService.save(entity));
    }

    @RequestMapping("/update")
    public ApiResponse update(BranchStore entity) {
        return ApiResponse.successApiResponse().withData(branchStoreService.updateSelectiveById(entity));
    }
}
